package com.waidi.clothespad.adapter;

import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.waidi.clothespad.R;
import java.util.List;

public class StyleNumInfoAdapter extends BaseAdapter {

    private Context mContext;
    private List<String> tvList;
    private String TAG =StyleNumInfoAdapter.class.getName();
    public StyleNumInfoAdapter(Context mContext, List<String> tv) {
        // TODO Auto-generated constructor stub
        this.mContext = mContext;
        this.tvList = tv;
    }
    @Override
    public int getCount() {
        // TODO Auto-generated method stub

        return tvList.size();
    }

    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    @Override
    public View getView(final int position, View convertView, final ViewGroup parent) {
        // TODO Auto-generated method stub
        try {


        final ViewHolder holder;
        if (convertView == null) {
            LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = inflater.inflate(R.layout.styleinfo_item1, null);
            holder = new StyleNumInfoAdapter.ViewHolder();
            holder.tv1 = (TextView) convertView.findViewById(R.id.tv_info);
            convertView.setTag(holder);
        }
        else
        {
            holder = (ViewHolder) convertView.getTag();
        }
       // holder.tv1.setBackgroundColor(Color.TRANSPARENT);
        holder.tv1.setText(tvList.get(position));
        Log.i(TAG,"=======");
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return convertView;
    }





    class ViewHolder {
        public 	TextView tv1;
    }

}
